#pragma once

#include"../net/campus_whole_server.h"

const std::string SIGNAL_TYPE_CREATE_CLUB = "create_club";
const std::string SIGNAL_TYPE_RESP_CREATE_CLUB = "resp_create_club";

const std::string SIGNAL_TYPE_JOIN_CLUB = "join_club";
const std::string SIGNAL_TYPE_RESP_JOIN_CLUB = "resp_join_club";
const std::string SIGNAL_TYPE_SEARCH_CLUB = "search_club";
const std::string SIGNAL_TYPE_RESP_SEARCH_CLUB = "resp_search_club";

const std::string SIGNAL_TYPE_CLUB_INFO = "club_info";
const std::string SIGNAL_TYPE_RESP_CLUB_INFO = "resp_club_info";
const std::string SIGNAL_TYPE_GROUP_INFO = "group_info";
const std::string SIGNAL_TYPE_RESP_GROUP_INFO = "resp_group_info";


const std::string SIGNAL_TYPE_GROUP_CHAT = "group_chat";
const std::string SIGNAL_TYPE_RESP_GROUP_CHAT = "resp_group_chat";

enum class CampusClubRet {
	//服务端回复社团创建
	CLUB_CREATE_RET_SUCESS,
	CLUB_CREATE_RET_EXIST,
	CLUB_CREATE_RET_FAIL,

	//服务端回复社团查看
	CLUB_SEARCH_RET_SUCESS,
	CLUB_SEARCH_RET_FAIL,

	//服务端回复社团加入
	CLUB_JOIN_RET_SUCESS,
	CLUB_JOIN_RET_EXIST,
	CLUB_JOIN_RET_FAIL,

	//服务端回复社团查询
	CLUB_INFO_RET_SUCESS,
	CLUB_INFO_RET_FAIL,

	//服务端回复社团
	CLUB_GROUP_RET_SUCESS,
	CLUB_GROUP_RET_FAIL,

	//服务端回复发送消息
	CLUB_GROUP_CHAT_RET_SUCESS,
	CLUB_GROUP_CHAT_RET_FAIL
};

enum CampusClubSqlType {
	//社团创建
    CLUB_SQL_SELECT_CREATE_CLUB,  
    CLUB_SQL_INSERT_CREATE_CLUB,

	//社团搜索
    CLUB_SQL_SELECT_SEARCH_CLUB,

	//社团加入
    CLUB_SQL_SELECT_JOIN_CLUB,
    CLUB_SQL_INSERT_JOIN_CLUB,

	//加入的社团查询
	CLUB_SQL_SELECT_CLUB_INFO,

	//社团成员查询
	CLUB_SQL_SELECT_CLUB_GROUP,

	//社团消息查询，消息转发
	CLUB_SQL_SELECT_GROUP_CHAT	
};

struct CampusClubInfo: public CampusSqlInfo
{
    CampusClubSqlType type;

	std::string uid;
	std::string club_name;
	std::string student_name;
	std::string student_id;
	std::string class_;
	std::string major;
	std::string college;
	std::string chat_info;
	int chat_serial;

	std::string teacher_name;
	std::string teacher_tel;

    virtual void dummpy_func(){}
};

struct CampusClubInfoObserver
{
	virtual void handleClubCreate(websocketpp::connection_hdl hdl,json const JMsg) {};
	virtual void handleClubSearch(websocketpp::connection_hdl hdl,json const JMsg) {};
	virtual void handleClubJoin(websocketpp::connection_hdl hdl,json const JMsg) {};
	virtual void handleClubInfo(websocketpp::connection_hdl hdl,json const JMsg) {};
	virtual void handleClubGroup(websocketpp::connection_hdl hdl,json const JMsg) {};
	virtual void handleGroupChat(websocketpp::connection_hdl hdl,json const JMsg) {};
};



